﻿#include "InstructionTurnTableDisconnect.h"

#include "ScriptRunner.h"
#include "TurnTableCodec.h"

__SCRIPTINSTRUCTION_REGISTER(InstructionTurnTableDisconnect,ScriptInstruction::Instruction_TurnTable_Disconnect,&InstructionTurnTableDisconnect::fromByteArray1);

InstructionTurnTableDisconnect::InstructionTurnTableDisconnect()
{
  instructionFlag = Instruction_TurnTable_Disconnect;
}

InstructionTurnTableDisconnect::InstructionTurnTableDisconnect(InstructionTurnTableDisconnect const& instructionTurnTableDisconnect)
{
  *this=instructionTurnTableDisconnect;
}

InstructionTurnTableDisconnect& InstructionTurnTableDisconnect::operator=(InstructionTurnTableDisconnect const & instructionTurnTableDisconnect)
{
  *(ScriptInstruction*)this=instructionTurnTableDisconnect;
  return *this;
}

InstructionTurnTableDisconnect::~InstructionTurnTableDisconnect()
{}

void InstructionTurnTableDisconnect::run()
{
  scriptRunner->sendInstruction(deviceId,TurnTableCodec::TurnTable_Disconnect);
  scriptRunner->scriptWaitAndRun(scriptRunner->getInterval_instruction(),deviceId);
}

QString InstructionTurnTableDisconnect::toString()
{
  return QStringLiteral("断开转台");
}

QByteArray InstructionTurnTableDisconnect::toByteArray()
{
  return ScriptInstruction::toByteArray();
}

ScriptInstruction* InstructionTurnTableDisconnect::fromByteArray1(char * const src,int size,int * offset)
{
  (void)src;
  (void)size;
  (void)offset;
  return new InstructionTurnTableDisconnect();
}
